<html>
    <body>
        <pe:mcml>
            <script type="text/npl" refresh="false" src="VipToolTip.lua">
                <![CDATA[
                    -- UI
                    local VipToolTip = NPL.load("(gl)script/apps/Aries/Creator/Game/Tasks/VipToolTip/VipToolTip.lua")
                    local GetVipMemberByCode = NPL.load("(gl)Mod/WorldShare/cellar/Vip/GetVipMemberByCode/GetVipMemberByCode.lua")

                    -- service
                    local KeepworkService = NPL.load("(gl)Mod/WorldShare/service/KeepworkService.lua")

                    local firstOpen = true;
                    local page = document:GetPageCtrl()

                    function close()
                        page:CloseWindow()
                        VipToolTip:Close();
                    end

                    function get_window_style(w,h)
                        return Mod.WorldShare.Utils.FixCenter(w, h)
                    end

                    function open()
                        GameLogic.GetFilters():apply_filters('user_behavior', 1, 'click.vip.parents_help')
                        ParaGlobal.ShellExecute("open", KeepworkService:GetKeepworkUrl() .. "/vip", "", "", 1)
                        firstOpen = false;
                        page:Refresh(0);
                    end

                    function isFirstOpen()
                        return firstOpen;
                    end

                    function refreshVip()
                        GameLogic.GetFilters():apply_filters('user_behavior', 1, 'click.vip.payment_completed')
                        VipToolTip.RefreshVipInfo();
                        page:CloseWindow();
                    end

                    function isVip()
                        return Mod.WorldShare.Store:Get('user/isVip');
                    end

                    function onlyRecharge()
                        return VipToolTip.onlyRecharge;
                    end

                    function show_get_vip_member_by_code_page()
                        page:CloseWindow()
                        GetVipMemberByCode:Show()
                    end

                ]]>
            </script>
            <div width="100%" height="100%" ClickThrough = "false">
                <pe:if condition='<%=onlyRecharge()%>'>
                    <pe:if condition='<%=isVip()%>'>
                            <pe:if condition='<%=isFirstOpen()%>'>
                                <kp:window
                                    class="default"
                                    mode="lite"
                                    width="955"
                                    height="580"
                                    style="<%=get_window_style(955,580)%>"
                                    icon="Texture/Aries/Creator/keepwork/Window/title/biaoti_vip_32bits.png"
                                    onclose="close">
                                        <div style="margin-left: 10px; margin-top: 40px; width: 932px; height: 534x; background: url(Texture/Aries/Creator/keepwork/vip/huiyuan_932X534_32bits.png#0 0 932 534)">
                                            <div style="margin-left:55px;margin-top:340;">
                                                <div style="width: 184px;height: 124px;">
                                                    <input type="button"  onclick="open" style="width: 184px;height: 124px;background: url(Texture/Aries/Creator/keepwork/vip/btn_zhaojiazhangkaitong_184X124_32bits.png#0 0 184 124)" />
                                                    <div style="margin-left: 55px;margin-top: -45px;color: #000000;"><%=L"找家长续费" %></div>
                                                </div>
                                                <div style="width: 184px;height: 30px;margin-top: 5px;">
                                                    <input type="button" style="width: 184px;height: 50px;background: url(Texture/Aries/Creator/keepwork/worldshare_32bits.png#512 204 48 50:15 15 15 15);" value="<%= L'兑换会员' %>" onclick="show_get_vip_member_by_code_page()" />
                                                </div>
                                            </div>
                                        </div>
                                </kp:window>
                            </pe:if>
                            <pe:if condition='<%=not isFirstOpen()%>'>
                                <kp:window
                                    class="default"
                                    mode="lite"
                                    width="400"
                                    height="200"
                                    style="<%=get_window_style(400,200)%>"
                                    icon="Texture/Aries/Creator/keepwork/Window/title/biaoti_vip_32bits.png"
                                    onclose="close">
                                        <div style="padding: 30px;">
                                            <div style="font-size: 14px;margin-left: 0px;margin-top: 20px;color:#000000;">
                                                <%= L"请您在新打开的窗口中进行支付，支付完成前请不要关闭本窗口" %>
                                            </div>
                                            <div style="margin-left: 85px;margin-top:30px;">
                                                <input type="button" style="width: 150px;height: 30px;" class="mc_light_grey_button_with_fillet" onclick="refreshVip" value='<%= L"已完成支付" %>' />
                                            </div>
                                        </div>
                                </kp:window>
                            </pe:if>
                    </pe:if>
                    <pe:if condition='<%=not isVip()%>'>
                            <pe:if condition='<%=isFirstOpen()%>'>
                                <kp:window
                                    class="default"
                                    mode="lite"
                                    width="955"
                                    height="580"
                                    style="<%=get_window_style(955,580)%>"
                                    icon="Texture/Aries/Creator/keepwork/Window/title/biaoti_vip_32bits.png"
                                    onclose="close">
                                        <div style="margin-left: 10px; margin-top: 40px; width: 932px; height: 534x; background: url(Texture/Aries/Creator/keepwork/vip/huiyuan_932X534_32bits.png#0 0 932 534)">
                                            <div style="margin-left:55px;margin-top:340;">
                                                <div style="width: 184px;height: 124px;">
                                                    <input type="button"  onclick="open" style="width: 184px;height: 124px;background: url(Texture/Aries/Creator/keepwork/vip/btn_zhaojiazhangkaitong_184X124_32bits.png#0 0 184 124)" />
                                                    <div style="margin-left: 43px;margin-top: -45px;color: #000000;"><%=L"找家长开通会员" %></div>
                                                </div>
                                                <div style="width: 184px;height: 30px;margin-top: 5px;">
                                                    <input type="button" style="width: 184px;height: 50px;background: url(Texture/Aries/Creator/keepwork/worldshare_32bits.png#512 204 48 50:15 15 15 15);" value="<%= L'兑换会员' %>" onclick="show_get_vip_member_by_code_page()" />
                                                </div>
                                            </div>
                                        </div>
                                </kp:window>
                            </pe:if>
                            <pe:if condition='<%=not isFirstOpen()%>'>
                                <kp:window
                                    class="default"
                                    mode="lite"
                                    width="400"
                                    height="200"
                                    style="<%=get_window_style(400,200)%>"
                                    title='<%=L"Paracraft会员" %>'
                                    onclose="close">
                                        <div style="padding: 30px;">
                                            <div style="font-size: 14px;margin-left: 0px;margin-top: 20px;color:#000000;">
                                                <%= L"请您在新打开的窗口中进行支付，支付完成前请不要关闭本窗口" %>
                                            </div>
                                            <div style="margin-left: 85px;margin-top:30px;">
                                                <input type="button" style="width: 150px;height: 30px;" class="mc_light_grey_button_with_fillet" onclick="refreshVip" value='<%= L"已完成支付" %>' />
                                            </div>
                                        </div>
                                </kp:window>
                            </pe:if>
                    </pe:if>
                </pe:if>
                <pe:if condition='<%=not onlyRecharge()%>'>
                    <pe:if condition='<%=isFirstOpen()%>'>
                        <kp:window
                            class="default"
                            mode="lite"
                            width="955"
                            height="580"
                            style="<%=get_window_style(955,580)%>"
                            icon="Texture/Aries/Creator/keepwork/Window/title/biaoti_vip_32bits.png"
                            onclose="close">
                                <div style="margin-left: 10px; margin-top: 40px; width: 932px; height: 534x; background: url(Texture/Aries/Creator/keepwork/vip/huiyuan_932X534_32bits.png#0 0 932 534)">
                                    <div style="margin-left:55px;margin-top:340;">
                                        <div style="width: 184px;height: 124px;">
                                            <input type="button"  onclick="open" style="width: 184px;height: 124px;background: url(Texture/Aries/Creator/keepwork/vip/btn_zhaojiazhangkaitong_184X124_32bits.png#0 0 184 124)" />
                                            <div style="margin-left: 55px;margin-top: -45px;color: #000000;"><%=L"找家长续费" %></div>
                                        </div>
                                        <div style="width: 184px;height: 30px;margin-top: 5px;">
                                            <input type="button" style="width: 184px;height: 50px;background: url(Texture/Aries/Creator/keepwork/worldshare_32bits.png#512 204 48 50:15 15 15 15);" value="<%= L'兑换会员' %>" onclick="show_get_vip_member_by_code_page()" />
                                        </div>
                                    </div>
                                </div>
                        </kp:window>
                    </pe:if>
                    <pe:if condition='<%=not isFirstOpen()%>'>
                        <kp:window
                            class="default"
                            mode="lite"
                            width="400"
                            height="200"
                            style="<%=get_window_style(400,200)%>"
                            icon="Texture/Aries/Creator/keepwork/Window/title/biaoti_vip_32bits.png"
                            onclose="close">
                                <div style="padding: 30px;">
                                    <div style="font-size: 14px;margin-left: 0px;margin-top: 20px;color:#000000;">
                                        <%= L"请您在新打开的窗口中进行支付，支付完成前请不要关闭本窗口" %>
                                    </div>
                                    <div style="margin-left: 85px;margin-top:30px;">
                                        <input type="button" style="width: 150px;height: 30px;" class="mc_light_grey_button_with_fillet" onclick="refreshVip" value='<%= L"已完成支付" %>' />
                                    </div>
                                </div>
                        </kp:window>
                    </pe:if>
                </pe:if>
            </div>            
        </pe:mcml>
    </body>
</html>
